package com.homeworkp8.Worker2Test;

public class Scientist extends Employee {
    //（2）科学家除基本工资外有年终奖
    double bonus;


    public Scientist(String name, double dailySalary, int day) {
        super(name, dailySalary, day);
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    @Override
    public void printSalary() {
        System.out.println(getName()+"的年薪为:\t " + (getDailySalary()*getDay() + bonus));
    }
}
